package com.ffyc.cms.service;

import com.ffyc.cms.dao.AdvertisingDao;
import com.ffyc.cms.model.Admin;
import com.ffyc.cms.model.Advertising;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class AdvertisingService {
    @Autowired
    AdvertisingDao advertisingDao;
    public List<Advertising> getadvertisingList() {
        return advertisingDao.getadvertisingList();
    }

    public Advertising getadvertisingListById(Integer id) {
        return advertisingDao.getadvertisingListById(id);
    }

    public void updateAdv(Advertising advertising, Admin admin) {
        advertising.setAdmin(admin);
        advertisingDao.updateAdv(advertising);
    }
}
